window.onload = function () {
    function MyQueue(speed, midi, firstPic, secondPic) {
        secondPic.innerHTML = firstPic.innerHTML;

        function Marquee() {
            if (midi.scrollLeft >= firstPic.scrollWidth) {
                midi.scrollLeft = 0;
            } else {
                midi.scrollLeft++;
            }
        }

        let MyMar = setInterval(Marquee, speed);
        midi.onmouseover = function () {
            clearInterval(MyMar);
        }
        midi.onmouseout = function () {
            MyMar = setInterval(Marquee, speed);
        }
    }

    const demo = document.getElementById('demo');
    const first = document.getElementById('marquePic1')
    const second = document.getElementById('marquePic2')
    MyQueue(20, demo, first, second);
    const demo1 = document.getElementById('demo1');
    const first2 = document.getElementById('marquePic3');
    const second2 = document.getElementById('marquePic4')
    MyQueue(20, demo1, first2, second2);
    const demo2 = document.getElementById('demo2');
    const first3 = document.getElementById('marquePic5');
    const second4 = document.getElementById('marquePic6')
    MyQueue(20, demo2, first3, second4);


}
